package com.lmaye.exceptions;

import com.lmaye.common.ErrorInfo;
import lombok.Getter;

/**
 * -- 通用异常
 *
 * @author lmay.Zhou
 * @qq 379839355
 * @email lmay@lmaye.com
 * @since 2019/6/9 9:50 星期日
 */
public class CommonException extends RuntimeException {
    /**
     * 序列化版本号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 错误信息
     */
    @Getter
    private ErrorInfo error;

    public CommonException(ErrorInfo error) {
        super(error.getMsg());
        this.error = error;
    }

    public CommonException(ErrorInfo error, Throwable cause) {
        super(error.getMsg(), cause);
        this.error = error;
    }
}
